﻿//2009-12-22    新增登出按鈕            By Victor
//2010-05-20    新增更新Timeout時間     By Victor
//2010-06-02    新增判斷是否重複送出    By Victor
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

using DataAccess;

namespace iEN.UserControl
{
    public partial class TopMenu : System.Web.UI.UserControl
    {
        #region protected void Page_Load(object sender, EventArgs e)        //頁面初始
        protected void Page_Load(object sender, EventArgs e)
        {
            Session["AliveTime"] = DateTime.Now;
            
        }
        #endregion

        #region protected void btnLogout_Click(object sender, EventArgs e)      //按下『登出』按鈕
        protected void btnLogout_Click(object sender, EventArgs e)
        {
            string strAccount = Session["LoginAccount"].ToString();
            string strIP = Session["LoginIP"].ToString();
            
            new DBAccess().addEventLog(strAccount, strIP, 2, "", "1");
            
            Session["SysAdmin"] = "";
            Session["LoginID"] = "";
            Session["LoginName"] = "";
            Session["LoginIP"] = "";
            Session["AliveTime"] = "";
            Response.Redirect("../Login.aspx");
        }
        #endregion

    }
}